﻿using System.Text.RegularExpressions;

namespace BBCode
{
    public static class Regex
    {
        /// <summary>
        /// Gets the auto parse regex.
        /// </summary>
        public static System.Text.RegularExpressions.Regex AutoParseRegex
        {
            get
            {
                return
                    new System.Text.RegularExpressions.Regex(
                        @"(?<!')(?<!"")(?<!"">)(?<!'>)((https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\""\[\]\s\*<\[\)]*)?))",
                        RegexOptions.Compiled);
            }
        }

        /// <summary>
        /// Gets the option regex.
        /// </summary>
        public static System.Text.RegularExpressions.Regex OptionRegex
        {
            get
            {
                return
                    new System.Text.RegularExpressions.Regex(@"(?<Property>[\w]*)[\s]*=[\s]*(?<Value>[\x25\w/\:/.-]*)",
                                                             RegexOptions.Compiled);
            }
        }
    }
}